package com.pxst.fi.req;

import com.pxst.annotations.validated.DateValidator;
import com.pxst.req.BasePageRsp;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author rj
 * @create 2023-09-19-14:32
 */
@Data
public class MerchantStatementReq extends BasePageRsp {

    @ApiModelProperty("商户id")
    private Long merchantId;

    @NotBlank
    @ApiModelProperty(value = "币种", required = true)
    private String currency;

    @ApiModelProperty("类型（0-充值，1-代付，2-下发，3-内转，4-余额，5-银行充值，6-True Wallet充值，7-QR充值）")
    private List<Integer> type;

    @ApiModelProperty("交易id")
    private String transactionId;

    @ApiModelProperty(value = "交易开始时间", required = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date transactionStartDate;

    @ApiModelProperty(value = "交易结束时间", required = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date transactionEndDate;

    @DateValidator
    public Map<String, Object> getDateValidated() {
        Map<String, Object> map = new HashMap<>();
        map.put("class", MerchantStatementReq.class.getSimpleName());
        map.put("transactionStartDate", transactionEndDate);
        map.put("transactionEndDate", transactionEndDate);
        return map;
    }

}
